import qs from "qs"
import request from "@/request/request"
// export const JingPinAPI = () =>
//   request.get("/products/recommend", {
//     headers: {
//       token: 123456,
//     },
//   });
//请求精品数据
export const JingPinAPI = () => request.get("/products/recommend")
    //请求热门兑换数据
export const ReMenAPI = () => request.get("/products/hot");
//获取验证码
export const SendSMSAPI = (params) => request.post("/sendSMS", qs.stringify(params));
//登录请求
export const PhoneReginAPI = (params) => request.post("/phoneRegin", qs.stringify(params));
//微信扫码登录请求
export const WeiXinLoginAPI = (params) => {
    return request.post("/wechatUsers/PCLogin", qs.stringify(params));
};
// 手机关联微信
export const BindingAPI = (params) => request.post("/wechatUsers/binding", qs.stringify(params))
    //获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");
//详情页信息 
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
//加入购物车
export const AddToCartAPI = (params) =>
    request.post("/shop/carts/add", qs.stringify(params));
// 商品搜索（含首页的“更多”）
export const GoodsSearchAPI = (params) => request.get(`/products`, { params });
// 查看购物车
export const ShopCartsAPI = () => request.get("/shop/carts")
    // 购物车删除商品
export const DeleteCartsAPI = (id) => request.delete(`/shop/carts?productIds=${id}`)